CC = gcc
CXX = g++

HEADER_PATH = -I/usr/include/drm/ -I/usr/include/va -I./include/
LIB_PATH = -L/usr/local/lib/ -L/usr/lib/aarch64-linux-gnu/
LIBS = -lva -lva-drm -ldrm -lpthread


CFLAGS = -Wall -g -fPIC

TARGET = ./encTurbo

LIB_TARGET = libencTurbo.so

%.o:%.c
	$(CC) $(CFLAGS) $(HEADER_PATH) -c $< -o $@ $(LIB_PATH) $(LIBS)

SOURCES = $(wildcard src/*.cpp src/*.c demo/*.cpp demo/*.c)

LIB_SOURCES = $(wildcard src/*.cpp src/*.c )


LIB_OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(LIB_SOURCES)))

OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCES)))


$(TARGET) : $(OBJS)
	@echo $(LIB_SOURCES)
	$(CC) $(LIB_OBJS) -shared -o $(LIB_TARGET) $(LIB_PATH) $(LIBS)


demo: $(OBJS)
	@echo $(SOURCES)
	$(CC) $(OBJS) -o $(TARGET) $(LIB_PATH) $(LIBS)

clean:
	rm -rf *.o src/*.o demo/*.o $(LIB_TARGET) $(TARGET)
	
